﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace yq.IService
{
    [ServiceContract]
    public interface ITask
    {
        /// <summary>
        /// 调用等待回调
        /// </summary>
        /// <param name="taskId"></param>
        /// <returns></returns>
        [OperationContract]
        bool RunWait(string taskId);

        /// <summary>
        /// 调用不等待
        /// </summary>
        /// <param name="taskId"></param>
        [OperationContract(IsOneWay = true)]
        void Run(string taskId);

        /// <summary>
        /// 运行所有需要执行的任务
        /// </summary>
        /// <param name="taskNum">一次最多执行数量</param>
        [OperationContract(IsOneWay = true)]
        void ForRun(int taskNum);
    }
}
